package com.ttt.gdfood.mapper;

import com.ttt.gdfood.entity.Comment;
import com.ttt.gdfood.entity.Video;
import org.apache.ibatis.annotations.*;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Mapper
public interface VideoMapper {
    @Select("SELECT * FROM video ORDER BY id DESC")
    List<Video> allVideo();

    // 添加评论
    @Insert("INSERT INTO video(src,video_title,create_time,uid) VALUES(#{src},#{video_title},#{create_time},#{uid})")
    @Options(useGeneratedKeys = true,keyProperty = "id",keyColumn = "id")
    @Transactional
    void addVideo(Video video);
}
